/*
 * rectangle.h
 *
 *  Created on: 19.01.2013
 *      Author: Michael
 */

#ifndef RECTANGLE_H_
#define RECTANGLE_H_

#include <stdio.h>
#include <string.h>
#include "geometricform.h"

void rectangle_init(GeometricForm_t* pThis);
void rectangle_draw(GeometricForm_t* pThis);

typedef struct {
	GeometricForm_t gf;
	int x;
	int y;
	int width;
	int height;
} Rectangle_t;

GeometricFormClass_t class_rectangle = { &class_geometricForm,
		sizeof(Rectangle_t), rectangle_init, rectangle_draw };

void rectangle_init(GeometricForm_t* pThis) {
	int gfsize = sizeof(GeometricForm_t);
	memset(pThis + gfsize, 0, class_rectangle.size - gfsize);
}

void rectangle_draw(GeometricForm_t* pThis) {
	Rectangle_t* pRect = (Rectangle_t*)pThis;
	printf("Rectangle (%d, %d)[%d,%d]\n", pRect->x, pRect->y, pRect->height, pRect->width);
}

#endif /* RECTANGLE_H_ */
